package org.ali.structuralpattern.proxypattern.proxy;

import org.ali.structuralpattern.proxypattern.shape.Shape;

/**
 * 静态代理
 */
public class ShapeProxy1 implements Shape {
    private final Shape shape;
    private final String name;

    public ShapeProxy1(Shape shape, String name) {
        this.shape = shape;
        this.name = name;
    }

    @Override
    public void draw() {
        System.out.println("静态代理，访问者：" + name);
        shape.draw();
    }
}
